package unit03;

public class Demo05 {
    public static void main(String[] args) {
        int m = 8;
        long sum = calculateSum(m);
        System.out.println(sum);
    }

    private static long calculateSum(int m) {
        long sum = 0;
        long item = m;

        for (int i = 1; i <= 10; i++) {
            sum += item;
            item = item * 10 + m;
        }

        return sum;
    }
}
